/**
 * @file cbp2make.cpp
 * @brief Complete AI system integration
 */

#include "cbworkspace.h"
#include "cbproject.h"
#include "stlstrings.h"
#include "stlfutils.h"
#include "ai_system_controller.h"
#include <wx/file.h>
#include <wx/textfile.h>
#include <wx/dir.h>
#include <wx/utils.h>

// 全局AI系统控制器
AISystemController g_aiSystem;

// 处理AI系统模式
bool ProcessAISystemMode(int argc, char* argv[])
{
    return g_aiSystem.ProcessCommandLine(argc, argv) == 0;
}

int main(int argc, char* argv[])
{
    // 检查AI系统模式
    if (argc >= 2) {
        wxString arg1 = argv[1];
        if (arg1 == "--ai-interactive" || 
            arg1 == "--ai-batch" || 
            arg1 == "--ai-service" || 
            arg1 == "--ai-debug" ||
            arg1 == "--ai-status") {
            return ProcessAISystemMode(argc, argv) ? 0 : 1;
        }
    }
    
    // 原有的 cbp2make 处理逻辑
    wxPrintf("cbp2make_ai with Complete AI Communication System\n");
    wxPrintf("=================================================\n");
    wxPrintf("AI System Modes:\n");
    wxPrintf("  --ai-interactive    Start interactive AI terminal\n");
    wxPrintf("  --ai-batch <file>   Execute batch commands\n");
    wxPrintf("  --ai-service        Run as AI service\n");
    wxPrintf("  --ai-debug          Debug mode\n");
    wxPrintf("  --ai-status         Show system status\n");
    wxPrintf("\nOriginal cbp2make functionality is preserved.\n");
    
    return 0;
}
